package com.fanli.bigdata.mytest

import org.apache.spark.{SparkContext, SparkConf}

/**
 * Created by liangdong.wu on 2016/11/21.
 */
object RddDemo {

  def main(args: Array[String]) {
    val conf = new SparkConf().setAppName("MySpakDemo1").setMaster("local[*]")
    val sc = new SparkContext(conf)
    var inputRDD = sc.textFile("file:///D:/log.txt")
    var errorRDD= inputRDD.filter(line=>line.contains("error"))
    println(errorRDD.collect().mkString(","))
    sc.stop()
  }
}
